package cn.lynu.study.pratice11_1;
interface Predicate{
	boolean test(String t);
}
public class InterfacePredicate {
    public static void words(String[] array,Predicate predicate){
    	for (int i = 0; i < array.length; i++) {
            if (predicate.test(array[i])) {
                System.out.println(array[i]);
            }
        }
    }
public static void main(String[] args) {
        String[] array= new String[]{"1","12","123","1234","12345","123456","1234567","12345678","123456789"};
        Predicate predicate = s -> s.length() > 5;
        words(array,predicate);
    }
}


